package com.android.tea.entity;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;

public class Clientindustry {

	private String coinId;// 自身id
	private String coinName;// 名称
	private String parentId;// 父id
	private Clientindustry parent;

	private Collection<Clientindustry> tempClientindustries;

	private HashMap<String, Clientindustry> map = new HashMap<String, Clientindustry>();

	public String getCoinId() {
		return coinId;
	}

	public void setCoinId(String coinId) {
		this.coinId = coinId;
	}

	public String getCoinName() {
		return coinName;
	}

	public void setCoinName(String coinName) {
		this.coinName = coinName;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public Clientindustry getParent() {
		return parent;
	}

	public void setParent(Clientindustry parent) {
		this.parent = parent;
	}

	public HashMap<String, Clientindustry> getMap() {
		return map;
	}

	public void setMap(HashMap<String, Clientindustry> map) {
		this.map = map;
	}

	public Clientindustry getClientindustry(String key) {

		return (Clientindustry) map.get(key);
	}

	public ArrayList<Clientindustry> getArrayList(String key) {

		if (tempClientindustries == null) {
			tempClientindustries = map.values();
		}
		ArrayList<Clientindustry> tempArrayList;
		tempArrayList = new ArrayList<Clientindustry>();
		for (Clientindustry clientindustry : tempClientindustries) {
			if (key.equals(clientindustry.getParentId())) {
				tempArrayList.add(clientindustry);
			}
		}

		return tempArrayList;
	}

	@Override
	public String toString() {
		return coinName;
	}
}
